home *** CD-ROM | disk | FTP | other *** search
/ Aminet 37 / Aminet 37 (2000)(Schatztruhe)[!][Jun 2000].iso / Aminet / dev / lang / sofa.lha / sofa / smalleiffel / lib_show / cecil / example6 / example.e < prev    next >
Text File  |  2000-03-25  |  915b  |  44 lines

  1. class EXAMPLE
  2.    --
  3.    -- The Eiffel program is running first, then call the C program
  4.    -- which is in charge to call the Eiffel feature `show_values'.
  5.    -- Note that the Eiffel root object is not explicitely passed to
  6.    -- the C world (external "C_WithoutCurrent").
  7.    -- Thus, the C code uses predefined `eiffel_root_object' to access
  8.    -- the very first created Eiffel object.
  9.    --
  10.    -- To compile this example, use command :
  11.    --
  12.    --         compile -cecil cecil.se example c_prog.c
  13.    --
  14.    -- Is is also possible to do :
  15.    --
  16.    --         gcc -c c_prog.o
  17.    --         compile -cecil cecil.se example c_prog.o
  18.    --
  19.  
  20. creation make
  21.  
  22. feature
  23.  
  24.    make is
  25.       do
  26.          do_it;
  27.          call_c_prog;
  28.       end;
  29.  
  30.    do_it is
  31.       do
  32.          io.put_string("Hi from Eiffel world.%N");
  33.       end;
  34.  
  35.  
  36. feature {NONE}
  37.  
  38.    call_c_prog is
  39.       external "C"
  40.       alias "c_prog"
  41.       end;
  42.  
  43. end -- EXAMPLE
  44.